<template>
  <div>
    <el-dialog v-bind="$attrs" :visible="visible" v-on="$listeners" @open="onOpen" @close="onClose"
               title="修改成交状态" width="500px"
    >
      <el-form ref="elForm" :model="formData" size="medium" label-width="110px">
        <el-form-item label="成交状态" prop="detailStatus">
          <el-select v-model="formData.detailStatus" placeholder="请选择成交状态" :style="{width: '100%'}">
            <el-option
              v-for="status in detailStatusOptions"
              :key="status.value"
              :label="status.label"
              :value="status.value"
            />
          </el-select>
        </el-form-item>
      </el-form>
      <div slot="footer">
        <el-button @click="close">取消</el-button>
        <el-button type="primary" @click="handleConfirm">确定</el-button>
      </div>
    </el-dialog>
  </div>
</template>
<script>
export default {
  name: 'DetailStatus',
  inheritAttrs: false,
  components: {},
  props: {
    detailStatus: {
      type: Number
    },
    visible: {
      type: Boolean,
      default: false
    }
  },
  data() {
    return {
      formData: {
        detailStatus: 1
      },
      detailStatusOptions: [
        {
          value: 1,
          label: '已成交'
        },
        {
          value: 0,
          label: '未成交'
        }
      ]
    }
  },
  computed: {},
  watch: {},
  created() {
  },
  mounted() {
  },
  methods: {
    onOpen() {
    },
    onClose() {
      this.$refs['elForm'].resetFields()
    },
    close() {
      this.$emit('update:visible', false)
    },
    handleConfirm() {
      this.$emit('ok', this.formData.detailStatus)
      this.close()
    }
  }
}

</script>
<style>
</style>
